<!doctype html>
<html>
<head>
	<meta charset="utf-8">
	<th:block th:include="include/src :: grid_base_js_and_css"/>
	
	<style>
	html {height: 100vh;background-color: #ffffff;}
	body {height: 100vh;}
	</style>
</head>
<body>
<!-- 是否导入 -->
<script type="text/html" id="templet_script_importState">
{{# if(d.importState === 1){ }}
<input type="checkbox" name="importState" value="{{d.importState}}" lay-skin="switch" lay-text="是|否" lay-filter="_input_filter_checkbox_on_menu_table" checked>
{{#  } else { }}
<input type="checkbox" name="importState" value="{{d.importState}}" lay-skin="switch" lay-text="是|否" lay-filter="_input_filter_checkbox_on_menu_table">
{{#  } }}
</script>
	<div class="display_flex" style="height: 100%;" id="id_panel_content">
	</div>
	
	<script type="text/html" id="toolbarDemo">
	</script>
	
	<script th:inline="javascript">
	var cols = [
	            [
	             {
					"title": "序号",
					"fixed": "left",
					"unresize": true,
					"width": "50",
					"align": "center",
	                 "type": "numbers"
				},
				{
					"title": "字段ID",
					"field": "id",
					"fixed": "left",
					"width": "80",
					"align": "center",
					"type": "normal"
				},
				{
					"title": "字段名称",
					"field": "name",
					"fixed": "left",
					"width": "120",
					"align": "center",
					"type": "normal"
				},
				{
					"title": "字段编码",
					"field": "code",
					"fixed": "left",
					"width": "120",
					"align": "center",
					"type": "normal"
				},
				{
					"title": "是否导入",
					"field": "importState",
					"width": "120",
					"align": "center",
					"type": "normal",
				    "templet": '#templet_script_importState'
				}
	         ]
	     ];
	var gridObj = null;
	//使用layui的模块
	layui.config({
		//自定义layui组件的目录,设定扩展的layui模块的所在目录，一般用于外部模块扩展
		base: '/static/js/layui_extends/'
	}).use(['form', 'jquery', 'element', 'table', 'dropdown', 'optimizeSelectOption', 'util', 'laydate', 'YsGridOfMainTable', 'YsModal'], function(){
		var $ = layui.jquery;
		var dropdown = layui.dropdown;
		var element = layui.element;
		var form = layui.form;
		var laydate = layui.laydate;
		var table = layui.table;
		var util = layui.util;
		var YsGridOfMainTable = layui.YsGridOfMainTable;
		gridObj = YsGridOfMainTable.init({
			id_panel_content: 'id_panel_content',
			conditions: [],
			menuId: [(${id})], // 菜单ID
			templateType: 'normal_list', // 模板类型，见ENUM
			pathGridRequest: '/api/inter/ysCol/search?menuId=[(${id})]', // 表格数据请求地址
			pathGridEditRequest: '/api/inter/common/editOnTable?menuId=12', // 表格上编辑提交地址
			cols: cols,
			sortType: 2
		});
	});
	
	// 调整鼠标移动到每行数据时的样式
	$('body').on("mouseenter",".layui-table-body tr",function () {
	    $(this).siblings().find("div").css("color","#142A48");
	    $(this).find("div").css("color","#4DA1FF");
	})
	</script>
</body>
</html>